package com.ruoyi.restaurant.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.*;
import java.util.Date;

/**
 * 餐台管理表 tb_dining_table
 *
 * @author ruoyi
 */
public class DiningTable extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    @Excel(name = "餐台序号", cellType = Excel.ColumnType.NUMERIC)
    private Long id;

    /**
     * 餐台号
     */
    @Excel(name = "餐台号")
    @NotBlank(message = "餐台号不能为空")
    @Size(min = 1, max = 20, message = "餐台号长度必须在1到20个字符之间")
    private String tableNumber;

    /**
     * 餐台类型（1-卡座 2-包间）
     */
    @Excel(name = "餐台类型", readConverterExp = "1=卡座,2=包间")
    @NotNull(message = "餐台类型不能为空")
    @Pattern(regexp = "^[12]$", message = "餐台类型只能是1（卡座）或2（包间）")
    private String tableType;

    /**
     * 餐台状态（0-空闲 1-使用中 2-已预定）
     */
    @Excel(name = "餐台状态", readConverterExp = "0=空闲,1=使用中,2=已预定")
    @Pattern(regexp = "^[012]$", message = "餐台状态只能是0（空闲）、1（使用中）或2（已预定）")
    private String status;

    /**
     * 开台人（服务员姓名）
     */
    @Excel(name = "开台人")
    @Size(max = 50, message = "开台人姓名长度不能超过50个字符")
    private String waiterName;

    /**
     * 就餐人数
     */
    @Excel(name = "就餐人数")
    @Min(value = 0, message = "就餐人数不能小于0")
    private Integer guestCount;

    /**
     * 开台时间
     */
    @Excel(name = "开台时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date openTime;

    /**
     * 预定人姓名
     */
    @Excel(name = "预定人姓名")
    @Size(max = 50, message = "预定人姓名长度不能超过50个字符")
    private String reservationName;

    /**
     * 预定人电话
     */
    @Excel(name = "预定人电话")
    @Size(max = 20, message = "预定人电话长度不能超过20个字符")
    private String reservationPhone;

    /**
     * 预定时间
     */
    @Excel(name = "预定时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date reservationTime;

    /**
     * 预定人数
     */
    @Excel(name = "预定人数")
    @Min(value = 0, message = "预定人数不能小于0")
    private Integer reservationCount;

    @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Excel(name = "更新时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTableNumber() {
        return tableNumber;
    }

    public void setTableNumber(String tableNumber) {
        this.tableNumber = tableNumber;
    }

    public String getTableType() {
        return tableType;
    }

    public void setTableType(String tableType) {
        this.tableType = tableType;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getWaiterName() {
        return waiterName;
    }

    public void setWaiterName(String waiterName) {
        this.waiterName = waiterName;
    }

    public Integer getGuestCount() {
        return guestCount;
    }

    public void setGuestCount(Integer guestCount) {
        this.guestCount = guestCount;
    }

    public Date getOpenTime() {
        return openTime;
    }

    public void setOpenTime(Date openTime) {
        this.openTime = openTime;
    }

    public String getReservationName() {
        return reservationName;
    }

    public void setReservationName(String reservationName) {
        this.reservationName = reservationName;
    }

    public String getReservationPhone() {
        return reservationPhone;
    }

    public void setReservationPhone(String reservationPhone) {
        this.reservationPhone = reservationPhone;
    }

    public Date getReservationTime() {
        return reservationTime;
    }

    public void setReservationTime(Date reservationTime) {
        this.reservationTime = reservationTime;
    }

    public Integer getReservationCount() {
        return reservationCount;
    }

    public void setReservationCount(Integer reservationCount) {
        this.reservationCount = reservationCount;
    }

    @Override
    public Date getCreateTime() {
        return createTime;
    }

    @Override
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public Date getUpdateTime() {
        return updateTime;
    }

    @Override
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("tableNumber", getTableNumber())
                .append("tableType", getTableType())
                .append("status", getStatus())
                .append("waiterName", getWaiterName())
                .append("guestCount", getGuestCount())
                .append("openTime", getOpenTime())
                .append("reservationName", getReservationName())
                .append("reservationPhone", getReservationPhone())
                .append("reservationTime", getReservationTime())
                .append("reservationCount", getReservationCount())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}

